package org.example.scoresystem_backen.dto;

import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 简化的认证响应DTO
 */
@Data
@NoArgsConstructor
public class AuthResponse {

    private String token;
    private Integer id;
    private String username;
    private String userType;
    private String name;

    // 学生专用字段
    private String studentId;  // 学号
    private Integer classId;   // 班级ID
    private String className;  // 班级名称（年级+班级名称格式）

    /**
     * 管理员登录构造器
     */
    public AuthResponse(String token, Integer id, String username, String userType, String name) {
        this.token = token;
        this.id = id;
        this.username = username;
        this.userType = userType;
        this.name = name;
    }

    /**
     * 学生登录构造器
     */
    public AuthResponse(String token, Integer id, String username, String userType, String name,
                       String studentId, Integer classId, String className) {
        this.token = token;
        this.id = id;
        this.username = username;
        this.userType = userType;
        this.name = name;
        this.studentId = studentId;
        this.classId = classId;
        this.className = className;
    }
}
